﻿Imports Microsoft.VisualBasic

Namespace My
    Public Class VolunteerIDBoundField
        Inherits BoundField

        Protected Overrides Function GetValue(ByVal controlContainer As System.Web.UI.Control) As Object
            Dim value As String = MyBase.GetValue(controlContainer)
            'MyObj.WriteLog(value)
            'Return value

            If value.Length = 10 Then
                Return value.Substring(0, 3) + "XXX" + value.Substring(6, 4)
            Else
                Return value
            End If
        End Function

        Public Property Masked() As Boolean
            Get
                If ViewState("Masked") Is Nothing Then
                    ViewState("Masked") = True
                End If

                Return ViewState("Masked")
            End Get
            Set(ByVal value As Boolean)
                ViewState("Masked") = value
            End Set
        End Property
    End Class
End Namespace
